// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.psi.impl.source.tree;

import com.intellij.psi.JavaDocTokenType;
import com.intellij.psi.JavaTokenType;
import com.intellij.psi.impl.source.BasicElementTypes;
import com.intellij.psi.tree.TokenSet;

@SuppressWarnings("unused") //because of backward compatibility, some of these sets are used in plugins
public interface ElementType extends JavaTokenType, JavaDocTokenType, JavaElementType, JavaDocElementType {
  TokenSet JAVA_PLAIN_COMMENT_BIT_SET = BasicElementTypes.BASIC_JAVA_PLAIN_COMMENT_BIT_SET;
  TokenSet JAVA_COMMENT_BIT_SET = TokenSet.orSet(JAVA_PLAIN_COMMENT_BIT_SET, TokenSet.create(DOC_COMMENT));

  TokenSet JAVA_COMMENT_OR_WHITESPACE_BIT_SET = TokenSet.orSet(TokenSet.WHITE_SPACE, JAVA_COMMENT_BIT_SET);

  TokenSet KEYWORD_BIT_SET = BasicElementTypes.BASIC_KEYWORD_BIT_SET;

  TokenSet LITERAL_BIT_SET = BasicElementTypes.BASIC_LITERAL_BIT_SET;

  TokenSet OPERATION_BIT_SET = BasicElementTypes.BASIC_OPERATION_BIT_SET;

  TokenSet MODIFIER_BIT_SET = BasicElementTypes.BASIC_MODIFIER_BIT_SET;

  TokenSet PRIMITIVE_TYPE_BIT_SET = BasicElementTypes.BASIC_PRIMITIVE_TYPE_BIT_SET;

  TokenSet EXPRESSION_BIT_SET = TokenSet.create(
    REFERENCE_EXPRESSION, LITERAL_EXPRESSION, THIS_EXPRESSION, SUPER_EXPRESSION,
    PARENTH_EXPRESSION, METHOD_CALL_EXPRESSION,
    TYPE_CAST_EXPRESSION, PREFIX_EXPRESSION, POSTFIX_EXPRESSION, BINARY_EXPRESSION,
    POLYADIC_EXPRESSION, CONDITIONAL_EXPRESSION,
    ASSIGNMENT_EXPRESSION, NEW_EXPRESSION, ARRAY_ACCESS_EXPRESSION,
    ARRAY_INITIALIZER_EXPRESSION, INSTANCE_OF_EXPRESSION,
    CLASS_OBJECT_ACCESS_EXPRESSION, METHOD_REF_EXPRESSION, LAMBDA_EXPRESSION, SWITCH_EXPRESSION,
    EMPTY_EXPRESSION,
    TEMPLATE_EXPRESSION);

  TokenSet ANNOTATION_MEMBER_VALUE_BIT_SET = TokenSet.orSet(EXPRESSION_BIT_SET,
                                                            TokenSet.create(ANNOTATION, ANNOTATION_ARRAY_INITIALIZER));

  TokenSet ARRAY_DIMENSION_BIT_SET = TokenSet.create(
    REFERENCE_EXPRESSION, LITERAL_EXPRESSION, THIS_EXPRESSION, SUPER_EXPRESSION,
    PARENTH_EXPRESSION, METHOD_CALL_EXPRESSION,
    TYPE_CAST_EXPRESSION, PREFIX_EXPRESSION, POSTFIX_EXPRESSION, BINARY_EXPRESSION,
    POLYADIC_EXPRESSION, CONDITIONAL_EXPRESSION,
    ASSIGNMENT_EXPRESSION, NEW_EXPRESSION, ARRAY_ACCESS_EXPRESSION, INSTANCE_OF_EXPRESSION,
    CLASS_OBJECT_ACCESS_EXPRESSION,
    EMPTY_EXPRESSION);

  TokenSet JAVA_STATEMENT_BIT_SET = TokenSet.create(
    EMPTY_STATEMENT, BLOCK_STATEMENT, EXPRESSION_STATEMENT, EXPRESSION_LIST_STATEMENT,
    DECLARATION_STATEMENT, IF_STATEMENT,
    WHILE_STATEMENT, FOR_STATEMENT, FOREACH_STATEMENT, DO_WHILE_STATEMENT,
    SWITCH_STATEMENT, SWITCH_LABEL_STATEMENT, BREAK_STATEMENT,
    CONTINUE_STATEMENT, RETURN_STATEMENT, THROW_STATEMENT, SYNCHRONIZED_STATEMENT,
    TRY_STATEMENT, LABELED_STATEMENT, ASSERT_STATEMENT,
    YIELD_STATEMENT);

  TokenSet JAVA_PATTERN_BIT_SET = TokenSet.create(TYPE_TEST_PATTERN, DECONSTRUCTION_PATTERN, UNNAMED_PATTERN);

  TokenSet JAVA_CASE_LABEL_ELEMENT_BIT_SET =
    TokenSet.orSet(JAVA_PATTERN_BIT_SET, EXPRESSION_BIT_SET, TokenSet.create(DEFAULT_CASE_LABEL_ELEMENT));

  TokenSet JAVA_MODULE_STATEMENT_BIT_SET = TokenSet.create(
    REQUIRES_STATEMENT, EXPORTS_STATEMENT, OPENS_STATEMENT, USES_STATEMENT, PROVIDES_STATEMENT);

  TokenSet IMPORT_STATEMENT_BASE_BIT_SET = TokenSet.create(IMPORT_STATEMENT, IMPORT_STATIC_STATEMENT, IMPORT_MODULE_STATEMENT);
  TokenSet CLASS_KEYWORD_BIT_SET = BasicElementTypes.BASIC_CLASS_KEYWORD_BIT_SET;
  TokenSet MEMBER_BIT_SET = TokenSet.create(CLASS, FIELD, ENUM_CONSTANT, METHOD, ANNOTATION_METHOD);
  TokenSet FULL_MEMBER_BIT_SET = TokenSet.orSet(MEMBER_BIT_SET, TokenSet.create(
    CLASS_INITIALIZER));

  TokenSet INTEGER_LITERALS = BasicElementTypes.BASIC_INTEGER_LITERALS;
  TokenSet REAL_LITERALS = BasicElementTypes.BASIC_REAL_LITERALS;
  TokenSet STRING_LITERALS = BasicElementTypes.BASIC_STRING_LITERALS;
  TokenSet TEXT_LITERALS = BasicElementTypes.BASIC_TEXT_LITERALS;

  TokenSet STRING_TEMPLATE_FRAGMENTS = BasicElementTypes.BASIC_STRING_TEMPLATE_FRAGMENTS;

  TokenSet ALL_LITERALS = BasicElementTypes.BASIC_ALL_LITERALS;
}